import http from '@/utils/request'
const URL = '/breed/shipmentOutBill'


//按基地id、类型分页查询肉鸽出库订单
export function getAllInfoByPage(pageNum = 1, pageSize = 10,data) {
    return http({
        url:`${URL}/getShipmentOutBill?baseId=${data.baseId}&type=${data.type}&pageNum=${pageNum}&pageSize=${pageSize}`,
        method: 'get',
    })
}

//根据日期查鸽棚
export function getByDateInfo(data,pageNum=1,pageSize=10) {
    return http({
        url:`${URL}/getShipmentOutBillByDate?baseId=${data.baseId}&type=${data.type}&date=${data.date}&pageNum=${pageNum}&pageSize=${pageSize}`,
        method: 'get',
    })
}

//提交基地出库单
export function AddOrder(data) {
    return http({
        url:`${URL}/submit`,
        method: 'post',
        data
    })
}

//提交基地进库单
export function AddStorage(data) {
    return http({
        url:`/breed/shipmentEntryBill/submitShipmentEntryBill`,
        method: 'post',
        data
    })
}

//通过批次号查询数据
export function getInfoByBatch(data) {
    return http({
        url: `${URL}/getByFarmBatch?farmBatch=${data.farmBatch}&baseId=${data.baseId}&type=${data.type}`,
        method:'get'
    })
}

//删除基地出库单
export function deleteOrder(id) {
    return http({
        url: `${URL}/deletedBill?billId=${id}`,
        method: 'delete'
  })    
}

//种鸽入库
export function entryStorage(param) {
    return http({
        url: `/breed/shipmentEntryBill/getAllEntryBillByIdAndType`,
        method: 'get',
       param
    })
  }